Skip to content

*: feerecipient auto fetching#4407

Open
pinebit wants to merge 2 commits intomainfrom
pinebit/feerecipient-fetch-runtime
Open

*: feerecipient auto fetching#4407
pinebit wants to merge 2 commits intomainfrom
pinebit/feerecipient-fetch-runtime

Conversation

@pinebit
Copy link
Collaborator

@pinebit pinebit commented Mar 19, 2026

Add automatic background fetching of builder registrations from the Obol API to the builderRegistrationService. Previously operators had to manually run charon feerecipient fetch to pull fully signed registrations. Now the service periodically fetches from the API and merges results with file overrides, preferring the entry with the highest timestamp per validator.

Fetching schedule:

  • Immediate fetch on charon start
  • Every 1h if any validators have incomplete (partially signed) registrations
  • Every 24h if all registrations are fully signed
  • File override changes also trigger an immediate API fetch

The Run function now works even when no overrides file path is configured, as long as the Obol API address is set.

category: feature
ticket: none

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 23.27044% with 122 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.26%. Comparing base (c381f32) to head (19caf7c).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
app/builderregistration.go 22.44% 106 Missing and 8 partials ⚠️
app/app.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4407      +/-   ##
==========================================
+ Coverage   56.21%   56.26%   +0.04%     
==========================================
  Files         242      244       +2     
  Lines       32207    32508     +301     
==========================================
+ Hits        18106    18290     +184     
- Misses      11780    11875      +95     
- Partials     2321     2343      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// and reloads when either source is updated. It blocks until ctx is cancelled.
func (s *builderRegistrationService) Run(ctx context.Context) {
if s.path == "" {
if s.path == "" && s.obolClient == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will practically trigger only if the user runs Charon with

--overrides-file=""
--publish-address=""

, right?

What are the odds of having that? And if we want this to be disabled, shouldn't we have some better functionality rather than user having to specify the above 2 in such way?

This also relates to multiple decision trees further down in this function.

// fetchFromAPI calls the Obol API, processes the response, stores API overrides,
// and calls recompute. Returns true if any validators have incomplete registrations
// or if an error occurred (to retry sooner).
func (s *builderRegistrationService) fetchFromAPI(ctx context.Context) (hasIncomplete bool) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename hasIncomplete to retryEarly?
Or even make it an error and retry on error?
Or change the function signature to (hasIncomplete bool, err error)?

Right now we are returning hasIncomplete = true on error and it feels a bit incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants